From: Giovanni Campagna Date: Mon, 29 Oct 2012 16:39:00 +0000 (+0100) Subject: LoginDialog: clear previous auth failed messages when trying again X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5525 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=04debd162372602c86ba99aab8e183bc2e69d2b3;p=gnome-shell.git LoginDialog: clear previous auth failed messages when trying again When the user has the entered the password for the second time and clicked OK, clear messages from the previous attempt, so any new failure is shown clearly. https://bugzilla.gnome.org/show_bug.cgi?id=687132 --- diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 42477322e..757d7de6f 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -839,9 +839,13 @@ const LoginDialog = new Lang.Class({ }, _showMessage: function(userVerifier, message, styleClass) { - this._promptMessage.text = message; - this._promptMessage.styleClass = styleClass; - GdmUtil.fadeInActor(this._promptMessage); + if (message) { + this._promptMessage.text = message; + this._promptMessage.styleClass = styleClass; + GdmUtil.fadeInActor(this._promptMessage); + } else { + GdmUtil.fadeOutActor(this._promptMessage); + } }, _showLoginHint: function(verifier, message) { diff --git a/js/gdm/util.js b/js/gdm/util.js index 3615cf2f9..da31daab8 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -125,6 +125,9 @@ const ShellUserVerifier = new Lang.Class({ }, answerQuery: function(serviceName, answer) { + // Clear any previous message + this.emit('show-message', null, null); + this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null); }, diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index c86f13c11..b119783c1 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -208,9 +208,13 @@ const UnlockDialog = new Lang.Class({ }, _showMessage: function(userVerifier, message, styleClass) { - this._promptMessage.text = message; - this._promptMessage.styleClass = styleClass; - GdmUtil.fadeInActor(this._promptMessage); + if (message) { + this._promptMessage.text = message; + this._promptMessage.styleClass = styleClass; + GdmUtil.fadeInActor(this._promptMessage); + } else { + GdmUtil.fadeOutActor(this._promptMessage); + } }, _onAskQuestion: function(verifier, serviceName, question, passwordChar) {